/*jslint */
/*global List, Jedi */

/**
 * Класс списка панелей.
 *
 * @class
 * @name Jedi.ColumnsList
 * @extends List
 */
Jedi.ColumnsList = List.$extend({

    /**
     * Конструктор.
     *
     * @public
     * @function
     * @name Jedi.ColumnsList#$init
     * @param {Object} config
     * @return {void}
     */
    $init : function (config) {
        'use strict';
        var name, type,
            list = [];
        config = config || {};
        for (name in config) {
            if (config.hasOwnProperty(name)) {
                type = String(config[name] || '').toLowerCase() || 'text';
                type = type.slice(0, 1).toUpperCase() + type.slice(1);
                if (Jedi.Column[type] instanceof Jedi.Column) {
                    list.push(Jedi.Column[type].$create(name, config[name]));
                } else {
                    list.push(Jedi.Column.Text.$create(name, config[name]));
                }
            }
        }
        this.$super(list);
    }

});
